package edu.chl.dat255.bluebanana.presentation.impl;

import edu.chl.dat255.bluebanana.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import edu.chl.dat255.bluebanana.logic.impl.ProMan;


//This is where the app starts
public class SplashScreen extends Activity {
	private final int SPLASH_TIME = 2000;
	private boolean SHOW_SPLASH = true;
	
	private void startNextActivity() {
		startActivity(new Intent(SplashScreen.this, ProMan.class));
	}
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash_screen);
        Thread t = new Thread(){
        	
			@Override
			public void run() {
				try {
					while (SHOW_SPLASH){
						sleep(SPLASH_TIME);
						break;
					}
				} catch (InterruptedException e) {
					e.printStackTrace();
				} finally {
					finish();
					startNextActivity();
//					stop();
				}
			}	
        };
        t.start();

    }
}
